package edu.ynu.se.xiecheng.achitectureclass.entity;

import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonBackReference;
import javax.persistence.*;

/**
 * 摄像头数据实体类
 * 用于存储摄像头设备拍摄的图片数据
 */
@Data
@Entity
@Table(name = "camera_data")
public class CameraData extends LogicEntity {
    /**
     * 关联的摄像头设备
     * 记录该图片数据是由哪个摄像头设备拍摄的
     */
    @ManyToOne
    @JoinColumn(name = "device_id")
    @JsonBackReference("device-cameradata")
    private Device device;

    /**
     * 图片URL
     * 存储图片在阿里云OSS中的访问地址
     */
    @Column(name = "photo_url", length = 500)
    private String photoUrl;
}